# $Rev: 165 $

CC = gcc
CFLAGS = -Wall -Wextra -Wdeclaration-after-statement -Wbad-function-cast \
	-Wcast-qual -Wstrict-prototypes -Wmissing-declarations \
	-Wmissing-prototypes -g -D__DEBUG
LIBS = -lm
TARGET = test
SOURCES = file_db.c utils.c hash_table/hashtable.c hash_table/hashtable_itr.c md5lib/md5.c md5lib/md5_utils.c
OBJECTS = $(SOURCES:%.c=%.o)

all: $(TARGET)

$(TARGET): $(OBJECTS) test.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

utest: $(OBJECTS) db_tests.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -lcheck

-include .depend

.depend: $(SOURCES)
	$(CC) -MM $(SOURCES) > .depend

.PHONY: clean

clean:
	rm -f $(TARGET) $(OBJECTS) .depend db_tests.o utest
